// Created by liusc on 2020/8/5-9:24.
<template>
  <div class="budgetWrap">
    <div class="resource-manage">
      <div class="card-box">
        <div class="card-title">
          <span>申请信息</span>
        </div>
        <el-form ref="add-form" :model="form" :rules="rules" class="form-wrap" label-width="auto">
          <el-row>
            <el-col :span="8">
              <el-form-item label="预算编号" prop="budgetCode">
                <el-col class="in_txt">
                  {{
                  form.applyData.budgetCode
                  }}
                </el-col>
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="申请名称" prop="applyName">
                <el-col class="in_txt">
                  {{
                  form.applyData.applyName
                  }}
                </el-col>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="8">
              <el-form-item label="申请部门">
                <el-col class="in_txt">{{ applyDept2 }}</el-col>
              </el-form-item>
            </el-col>
            <el-col :span="16">
              <el-form-item label="申请类型">
                <el-col class="in_txt">{{ applyType2 }}</el-col>
              </el-form-item>
            </el-col>
          </el-row>
          <!--                    <el-row>-->
          <!--                        <el-col :span="8">-->
          <!--                            <el-form-item label="当前预算额">-->
          <!--                                <el-col class="in_txt">{{-->
          <!--                                    form.applyData.itemValue-->
          <!--                                }}</el-col>-->
          <!--                            </el-form-item>-->
          <!--                        </el-col>-->
          <!--                        <el-col :span="16">-->
          <!--                            <el-form-item label="追加预算额">-->
          <!--                                <el-col class="in_txt">{{-->
          <!--                                    form.applyData.itemValuePre-->
          <!--                                }}</el-col>-->
          <!--                            </el-form-item>-->
          <!--                        </el-col>-->
          <!--                    </el-row>-->
          <!--                    <el-row>-->
          <!--                        <el-col :span="8">-->
          <!--                            <el-form-item label="预算变化">-->
          <!--                                <el-col class="in_txt">{{-->
          <!--                                    form.applyData.changeAmount-->
          <!--                                }}</el-col>-->
          <!--                            </el-form-item>-->
          <!--                        </el-col>-->
          <!--                    </el-row>-->
          <div class="card-title mb20">
            <span>预算申报</span>
          </div>

          <el-table
            :data="form.itemValueList"
            class="dubgetTable mt20"
            row-key="itemId"
            default-expand-all
            :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
          >
            <el-table-column class="weight" header-align="center" prop="itemName" label="科目名称" width="300">
              <template slot-scope="scope">
                <span style="margin-left: 10px">{{ scope.row.itemName }}</span>
                <el-switch v-model="scope.row.isNead" v-if="scope.row.children == null" :width="28" active-value="1" inactive-value="0" />
              </template>
            </el-table-column>
            <el-table-column align="center" label="预算总金额(元)">
              <el-table-column align="center" prop="itemValue" :label="`${form.applyData.budgetSum}`">
                <template slot-scope="scope">
                  <el-input v-model="scope.row.itemValue" v-only-number="{min:0,precision:0}" type="number" :disabled="scope.row.children !== null" />
                </template>
              </el-table-column>
            </el-table-column>
          </el-table>
          <el-form-item class="mt20" label="费用说明" prop="applyData.remarks">
            <el-input v-model="form.applyData.remarks" placeholder="请输入费用说明" />
          </el-form-item>
        </el-form>
      </div>
    </div>
    <fileUpload ref="fileUpload" type="edit" :busId="fileId" :fileId="fileId2" @onSuccess="handleCompleted" />
    <!-- 上传附件部分=============================== -->
    <!--    <div class="resource-manage">-->
    <!--      <div class="card-box">-->
    <!--        <div class="card-title">文件上传</div>-->
    <!--        <div style="padding: 20px 20px">-->
    <!--          <upload-media type="file"-->
    <!--                        ref="myApply"-->
    <!--                        :url="fileUploadUrl"-->
    <!--                        :busId="busId"-->
    <!--                        :modelType="modelType"-->
    <!--                        @onSuccess="onSuccess"-->
    <!--                        @onError="onError"-->
    <!--                        @beforeUpload="beforeUpload"-->
    <!--                        @handleClean="handleClean"-->
    <!--                        :propsFileList="uploadFileList"-->
    <!--                        :isShowFileList="true"-->
    <!--                        :isView="false">-->
    <!--          </upload-media>-->
    <!--        </div>-->
    <!--      </div>-->
    <!--    </div>-->
    <!-- 取消保存部分============================== -->
    <div slot="footer" class="footer" style="padding-right: 0px">
      <el-button type="primary" v-throttle="[addCommit]">保 存</el-button>
      <el-button @click="cancel">取 消</el-button>
    </div>
  </div>
</template>

<script src="./addapply_add.js"></script>
<style lang="scss" scoped>
@import "./addapply_add";
</style>
